/* 
* TODO: 1. Place the .txt data file and the dictionary file you downloaded in the work folder, or enter the full path to these files!
*       2. You may have to increase memory using the 'set mem' statement. It is commented out in the code bellow.
*
* If you have any questions or need assistance contact info@socialexplorer.com.
*/

///set mem 512m
clear all
version 11
set more off
cd "C:\Users\dengh\Dropbox\Yale\Research\APEEP\data\income"
infile using "1980_R12408287.dct", using("1980_R12408287_SL11.txt") clear

destring FIPS, generate(fips)
ren T073_001 income_2000usd
ren T001_001 pop
keep fips income* pop
codebook income*

/*
-----------------------------------------------------------------------------------------------------------------------------
income_2000usd                               Per Capita Income In 2000 Dollars [Dollars adjusted for inflation to match value
-----------------------------------------------------------------------------------------------------------------------------

                  type:  numeric (double)

                 range:  [5830,47912]                 units:  1
         unique values:  2195                     missing .:  0/3137

                  mean:     13419
              std. dev:   2822.46

           percentiles:        10%       25%       50%       75%       90%
                             10180     11564     13207     14979     16651
*/

compress
saveold data_income_pop_1980, replace

